﻿/*
 * Created by SharpDevelop.
 * User: xieen
 * Date: 2013-08-16
 * Time: 15:41
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections;
using System.Collections.Generic;

namespace GoF23Learning._09.Composite_Pattern
{
	/// <summary>
	/// Description of App.
	/// </summary>
	public class App
	{
		public void Test()
		{
			IBox box = Factory.GetBox();
			if( box is ContainerBox){
				box.Process();
				List<IBox> list =((ContainerBox)box).GetBoxes();
				//递归处理......
			}else if( box is SingleBox)
			{
				box.Process();
			}
		}
	}
}
